package com.ftqh.tutorial.controller;

import com.alibaba.fastjson.JSONArray;
import com.ftqh.tutorial.service.ComputeClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2017/4/28.
 */
@RestController
public class ConsumerController {
    @Autowired
    ComputeClient computeClient;
    @GetMapping("/add")
    public Integer add() {
        return computeClient.add(10, 20);
    }
    @GetMapping("/users")
    public JSONArray getUsers() {
        String[] ids = {"1","2"};
        return computeClient.getUsers(ids);
    }

    @GetMapping("/users/bytes")
    public String sendBytes() {
        Byte [] file={1,1,1,1,1,1,};
        return computeClient.sendBytes(file);
    }
}
